Fix Sonar Issue: move constructor and field declarations