convert to underscore js and templates