dry up ground specs with shared examples
refactors javascript