more cleaning up of code