optimization and cleaning up. fixed the sizing issues before the dom fully painted itself