Remove view logic from controllers

Created on the scope of the directive instead as per PR feedback