refactor fragments