public static function apply( string $text, $context, string $skip = '', ?callable $callback = null ): string {

    //
    $context = Storage::instance( $context );

    $output    = '';
    $delimiter = null;
    for( $i = 0, $length = strlen( $text ); $i < $length; ++$i ) {

      // detect skipped blocks (start and end)
      if( $delimiter == $text{$i} ) $delimiter = null;
      else if( !$delimiter && strpos( $skip, $text{$i} ) !== false ) $delimiter = $text{$i};

      // try to process the insertion
      if( !$delimiter && $text{$i} == '{' ) {

        $buffer = '';
        for( $j = $i + 1; $j < $length && $text{$j} != '}'; ++$j ) {
          $buffer .= $text{$j};
        }
        $i = $j;

        $output .= $callback ? $callback( $buffer, $context ) : $context[ $buffer ];
        continue;
      }

      $output .= $text{$i};
    }

    return $output;
  }