more generic unit determination