Create robust constructor, refactor event malloc code