Offline and Online Plan Library Maintenance in Case-based Planning