Refactored source to be high quality according to StyleCop