Refactored treat generating functions.