Creating better controller for modals