refactor specs to use shared examples