refactored out modal