refactor with mz