fix and tidy