cleanup whitespace.
emit custom events