Refactor and improve specs.