mage some logical changes