Refactor/generalize so not quite so specific to ec2