ms refactor