made code for getting server fields more effective