Version 0.5 : Split up main.js for more maintainable code #3