[Magic-HD] Code cleanup