moving jsonp/js request related reply logic in one place. Keeping things DRY