minor tweaks mainly for the Sweeper

using some templates and typedefs to shorten a few lines and make the sweeper easier to derive from