log/server refactoring