Refactoring some code and using the index.js pattern for requires.