add findUnitByName method; code cleanup;