Refactoring. Added utils/ directory. Moved functions from utils.js to utils/