Split your application logic in modules like AMD in JS