[Magic-HD] Some more code cleanup.