refactored aws