cleaner code for markdown helper.