event constructors
emit event logic
refactor server code