move getStats to adapter.js