Moved patterns to static, small speed improvements