Cleanup and changes to the system to sort more functions