refactor  fragment