Moved small aux function into its calling function