some more refactoring
remove popup