split out modal code