log refactoring
history averaging