refactor code into functions
Merge pull request #2 from codewitch/tj_add_homepage

refactor code into functions