refactoring pubsub
refactoring after finding out an issue with $rootScope
adding new compiles
Mental note: done go against Angular dependency injection