Added popup to folder creation, refactored popup code