a bit of code cleanup2