some utils methods and related stuff, for the sake of DRY.