Tidy up and relocating the aux functions