factor it out a bit, to make it less of a bloat.