Heavy refactor to pull out kinetics code.