refactor code to allow programmatically calling calculate_IRI and calculate_SVI