refactoring: remove duplicated codes in chat_srv.erl and move_srv.erl.