Simplify and normalize markup