Simplified logic by removing ejs-locals (layouts).

Also touched up a bit on style.