refactor core tests to be a bit more dry