prepare options will open popup relative to current window center
code cleanup
refactored buildQueryString