Removed excessive script
Created universal function for binding events