moved utility helpers together in preparation of their extraction