removes dead code
moves some more event handlers
prevent default on all clicks