..F....... [DEV-539] templates.php:

 - formatting; minor code improvements