Refactored into core and server module.