added dynamic login popup and few code clean up.