Simplified by applying class to only child nodes and removed emitter dependency.