Able to save search as XML now, + refactor