Reorganize html tags and css for flexible layout