some cleanup and sending add/remove child events + add/remove focus events