Relocate some support functions