popup modal window approach (plus some cleaning)