+ split code from my prototype into view.js