Factor layout info out of html