replaced serializable_hash attr_reader with method and change emit to clone state rather than mutating it