Refactored to reduce number of huge methods; configured for SonarQube
runs