Modulize analytics and better production mode