Code cleanup in ObjectMgr