Converting AccountsService to use dependency injection