Tidied up a lot more code (mostly Resharper suggestions)

Signed-off-by: Martin Evans <martindevans@gmail.com>