code cleanup, added url_decoder (not used yet), better logic in mirror selection