prepare refactor