Minor cleanup and refactoring based on feedback from Scrutinizer and Sensio Insights.