Make reusable data fetch method. Closes #2.