refactor for final test