refactoring of import obj code