moving around a lot of code and cleaning things up