Refactored Outputting into the Template Class