dry principle implemented on comments.php

Cleaning up code so there are less repeats of code.