split code into smaller files

now replace old monolithic Server