Cleaned up controller code by implementing new_ec2