joy refactor