more optimal pruning