abstracts query to get data snapshot data into one function
abstracts away some duplicated code