Refactored ad layout code.
Layout tweaks.