Remove unnecessary parts from success function