before refactor