moved server protocol and factory to separate files
added new files