refactor units

need to remove the need for unitid