Refactoring plus adding sonar config.