Cleand up some code