Refactor helper
merged in refactoring of require helper