Refactored Imgadm