refactor for #6