Change stats collection code to new collections