Add some works with DocValues, improve code