modularizing the angular code