Added popup window for multiple results + some other refactoring