Adaptive window size...
More refactoring...