merge Hernan Martinez's  branch with bulk-leasequery branch of Tomasz Mrugalski