remove console log
Improve design. Code reuse in templating.