move logic to extertnal file + introduce views with handlebars