code cleanup and speciestree