factoring things out a bit