factors refactor