menu refactor and reaction to window resize added