re-organised a bit