refactor method