refactor get_data as separate module