Replace switch statement with hardcoded commands to a template-based solution