Fixed the factories accordingly