attribution and tidy up