Some slight optimizations, prepare for some HTML output