An improved implementation of total-field/scattered-field (TF/SF) boundary condition is presented to incorporate sources into electromagnetic models, specifically for finite-difference frequency-domain (FDFD). Compared with other TF/SF implementations, the proposed formulation modifies all the finite-difference equations containing field terms, taking care of numerical dispersion compensating at nonideal TF/SF regions, enabling the simulation of various advanced electromagnetic scattering phenomena. Several examples are showcased, including a crossed-grating guided-mode resonance filter (GMRF), parameter retrieval of a metamaterial, an invisible cloak designed by transformation optics (TO), and an optical-integrated circuit (OIC), whose results agree well with those from other literatures.