Refactor for modal class