[ci skip] - factoring some helper functions into common module