Cleaning up ec2 state/module code