Last version before splitting into classes.