More pipe read functions, separate into own file