cleanup code, add skip query option.