server module refactored