Refactor code to use same modal