Refactoring and pinning modals