rearanging server functions