factorizing test code, less lines for gist readability