exported module() and pipeline()
made pipeline() more robust