refactor hell