Refactoring of client classes. Added first ut (not working).