tidying code removing data to ext