refactor magicmock

seperated from chorus