split up of main.coffee