refactor erbs