Refactoring

Refactoring to client