Fix violation and remove not needed code