Cleans up the main converter code