some tweaks of the new bits from hector