moving nil logic to controller and out of view