change controller structure, minor fixes