Move notifyServer to a utlity function