Refactoring & Fixed Browser Refresh Issue