Refactored modal into modal.js