migrated unit detail extraction to it's own function