Move test read function to its own module