backport changes & cleanup from liquidm