Cleanup and preparation for new version of Trinity