Rip some test code out and reuse from other class