common lib for server