prior refactor