a lot more clean up of code