Added support for wherenot, default urlparams and better memory management