Some refactoring, some resolving, some cleaning