Refactor client side application