extracted test helper methods to separate file