Sort out bad code