refactor for clarity