Refactor idleness (lib)