Minor refactoring/formatting
Unbind previous event handlers before binding new ones