add beforeSend callback for hackability (one project uses puppet.xhr internally)
remove redundant code