minor fixes, some refactorings and new features (view CHANGELOG)