cleaned up dynamo db code