refactor in catalog.coffee