added moved code to client class