refactor .data() method