refactor server class as driver