refactor controllers & test