Some code maintanence

* Remove compile warnings
* Deleting unused functions,
* Remove cppcheck warnings