code safety, using spider and functions