Refactored a bit of aws commands