Spec and factory refactors