refactored,now can work with the refactored server