Organize the code of get_user_timeline method