First stage in converting the code to classes.