refactored demo server