web client refactoring