Refactor modal into Layout. Seperate modal code from form code