Refactoring and StyleCop warnings clean