refactor to use data parts