Fixes: #2595 Cleaning some code