capybara and refactoring