Minor cleanup, condensed some routines, moved some parameters into modules.