refactor for readability