moved lots of code to the common library so that I can reuse it for channel and world server