Eine bessere Lösung wären natürlich Pipes. Aber so "kompliziert" willst du es wohl nicht machen.