@Imran
Kia had technological collaboration with mazda from 70's to end 90's and most major parts are interchangable in these cars
Engine in mazda is 1.5BFD which is DOHC version of Mazda B5 with some minor changes brought in by KIA themselves.
engine, foundations, gearbox and other major items are same essentially