clean unnecessary functions and variables, refactoring, seperate server ...

...to another class