Change the theme specific crap into functions.. might bite me in the ass later tho