refactor inline with purity refactorings