Pass data to function to reduce reading time