Refactored client