#4137 deleting code and tidying references