Refactor prework