commit some server duplicate code?