started to refactor controllers