Some refactoring, some more comments