rewrite closer to backbone MVC style