refact Server method