Added StyleCop suggestions and some refactorings.