Fix issue #16, by moving the sign-in code to a service