Refactored AWS js utils.
Refactored CWS js utils.