encapsulate into functions
refactor in preparation for pulling out resize logic
gracefully resize in response to window event