refactoring sites controller