stage 1 of refactoring the client