[Magic-HD-Night/Noire]Code cleanup