refactory aws client