Some code cleanup in objectmgr