Added basic framework to collect statistics