Clean up - moved login, favorite related code in separate files