User device controller - rewrited to angularjs.