first split out of friendly functions