optimized AMD define() method