Minor refactoring
Fixed window resize