Faster html template, fix blocks detection