clean up code. support both coffee and js examples