Selection works + more refactoring