an large code refactor, optimize the manner of process resise event of window