Add a common data reading function