extract pseudo serial read operation into a seperate file