Refactored out the inline JS