Even more cleaning up of the code