Refactored dietary ratings calculations