refactored to inject favorite status