refactor:add StatsClass, add Context and Metric collections