refactor for isolation