added some organization to angular code