[WIP] Refactor MSM

Yeah we can sort this later, I don't mean to hold up the PR