Refactoring, fixing require bug.