moves controller into separate file