TiFilesystem code cleanup