Further code arrangement fixes