remote server refactoring