Small code improvement and some documentation
More PopupManager stuff