refactoring of aggragated variance estimator
added tests
refactoring of aggragated variance estimator