midas refactor