Refactor into classes.