Fixed flicker, added .active class, removed some excessive DOM elements.