refactoring sitecontroller