refactoring aws