better variable handling and add dry run mode