1) Projection, connected sets

2) Some refactoring