Add factory and refactored manage todo spec.