Precompile the patterns for efficiency and maintainability