A bit of re-factoring