handle data in a more refactor friendly way