refactor the markdown code