extracting data gathering methods to functions