Refactored modal jQuery