polish code according static analysis