bunch of tests working, refactoring common tests into own functions