Added a comment controller and migrated some code to it