move server into class