Clearing up some code