lean up some code