refactor: moving static to view and support .tpl suffix for template