refactor getData()