addtofavorites refactored