refactoring code to have single unified templates and static files