refactor code to load home timeline into seperate function