change cloud url and beautify code (TESTED)