Unit class added code refactored to accomodate the change