pre refactor