Removed common code from unit tests.