refactor into pipe classes, error handling, additional audit details