extract common logic to get ready to change homepage

a utils directory in controller might be a better directory