Refactoring test stuff a bit