Refactor code to use dynamodb instead of simpeldb