Move patterns to separate class