Tidied up Mage class a bit.