More cleanup into libs