Took logic out of controller