removed rootscope and made use of services