tidy up and soruce