DB refactoring, merge of pattern and measure.