refactoring; client integration