Removed optionalParams function (it was too weird and hacky :/)