use MagicalRecord and mogenerator