Refactoring and added config.js