A better way to retrieve data from DynamoDB in AWS