refactored templates to use base template and block system