Refactor CapybaraContext.