Some changes to be able to virtualize pattern matching part.