General pruning and tidying