Refactor services to simplify dealing with user credentials