Refactor nfs-related code