transformed server to OOP