refactoring apartments controller