code refactoring for card.js.coffee