refactor getObjectRev function