Refactor SharedLibraryTask.