  Currently time-domain astronomy can scan the entire sky on a daily basis,
discovering thousands of interesting transients every night. Classifying the
ever-increasing number of new transients is one of the main challenges for the
astronomical community. One solution that addresses this issue is the
robotically controlled Spectral Energy Distribution Machine (SEDM) which
supports the Zwicky Transient Facility (ZTF). SEDM with its pipeline PYSEDM
demonstrates that real-time robotic spectroscopic classification is feasible.
In an effort to improve the quality of the current SEDM data, we present here
two new modules, BYECR and CONTSEP. The first removes contamination from cosmic
rays, and the second removes contamination from non-target light. These new
modules are part of the automated PYSEDM pipeline and fully integrated with the
whole process. Employing BYECR and CONTSEP modules together automatically
extracts more spectra than the current PYSEDM pipeline. Using SNID
classification results, the new modules show an improvement in the
classification rate and accuracy of 2.8% and 1.7%, respectively, while the
strength of the cross-correlation remains the same. Improvements to the SEDM
astrometry would further boost the improvement of the CONTSEP module. This kind
of robotic follow-up with a fully automated pipeline has the potential to
provide the spectroscopic classifications for the transients discovered by ZTF
and also by the Rubin Observatory's Legacy Survey of Space and Time.
