bit of re-factoring