Simplify prune core method and add spec