refactoring, fixed z-index of moving window