Increase test coverage and a bit of code cleaning
Increase test coverage