Starting to factor out into various classes.