refactor for ease of use