better deriving of IDs