Pulled out into factory/controllers for habits and auth