refactored capybara tests