refactor coffeescript & design api