Consolidate stuff that should be in Lem lib