check for production env or optimize in correct place