wres code cleanup