Register event  listners

Code cleanup