Add helper function for processing orientation