substituded types where applicable
made Ret = Maybe Id