do pre-processing of pre-defined patterns