refactor b