Re-factor to allow importing of ec2 inventory plugin