cleanup and sort members