The refactoring sound reasonable, so just refactor it.