More Cleaning of the Code for A4

Split some code into other classes.