last bits of code cleanup (I hope)