Cleaned up code with Resharper.