Configuration refinements

Improve the code quality of the configuration sub-system:
remove some duplications, reduce method complexity, remove some unused code,
add some new test cases, improve code coverage, fix some code standard mistakes.
Merge pull request #808 from cristianoc72/config-refinement

Configuration refinements