moved methods from view to controller, included controller in view