Factories fixed and test compleated