Some simple code cleanups. Remove unused variables, make a few constants, Linq simplifications.