refactoring around the loadingSpinner, nicer jQuery concatenation of functions, removed redundant events subscription