refactor fraction