Code refactoring on client