Refactored switch coffee code