WIP start refactoring amazon lib