Restructure into classes.