split some functions off orient into their own module