Cleaning up remaining code