Fixes: #2595 Some code cleaning