re-organize helper functions into angular service
Merge pull request #137 from cloudspace/67567950_code_cleanup

re-organize helper functions into angular service