Small code re-arrangements