Slight code re-organization