refactor for Matt