Refactor to simplify Amazon API wrapper class into function.