Migrate to coffee + refactoring + fix issues