Some refactorings. Version updated to 1.1.1