Cleanup logic to unify usage of obj in get_inline_instances