cleaned up angular code