second attempt to place common code into one place (for kitPLugins)