Formatted code.
Replaced basic constants by enumerations.
Fixed first sonar issues.