Added EventHandlerFactory and change server code
Added EventHandlerFactory and change server code