Site - main controller and helper functions code cleanup