More work on main. Polished data classes.