Almost Done… Post Format Code

You can utilize the WordPress function get_template_part();

Create several template files in your theme directory called content-POST_FORMAT_TYPE.php – Example: content-gallery.php and content-chat.php

if(has_post_format('gallery'))
    get_template_part('content', 'gallery');
elseif(has_post_format('chat')
    get_template_part('content', 'chat');
else
    the_content();

This approach makes your code blocks reusable in multiple templates. Hope this helps you out.