refactored markdown code to model level

This is the Post Markdown checkpoint assignment at the bottom.  I refactored the markdown code to the model level.

Please review.