#667 copy definition to instance.plist
#667 code refactor