Refactor for simplification.