Location modifying, refactoring of the bindEventHandlers-function