More tests refactored

This is a final commit in series.

The patch is submitted under MIT license