Merge app logic for both windows

(WP2B & B2WP)