Some refactoring + added button "Save" (not functional yet)