refactored unit data creation