Refactoring code client