midnight mega refactor