moving the core emit functionality into a base class, removing some comments