mash refactor