Code is abstracted into Unit interface and measurement class