DW:ME Code refactor