Add ids factory
Improve spell factory and spell entity