improved match patterns