refactoring with erb