refactor six