refactoring (devide main.coffee)