Created user-modal.js, code refactoring