Upated to latest cloudfront API and made a couple refactorings