inital trial to rewrite code in angularjs, WiP