factory and spec fixes