refactoring some code out for smaller main.js
Release v0.0.7