Refactored unit class.