"[Magic-HD/Light] Some code clean up