factorise the code for css and js
introduce angularjs