Improved configuration; refactorings