refactor for program purpose