Mix of formatting fixing some major issues reported by sonar