cleaning up angular code