following suggestions from VS 2012 Code Analysis