Code improvements in EC2 connector