Reorganize structure of patterns