refactoring sanity