modularizing the client