refactoring with rootscope, favorites functionality