refactor to ec2 test