added date function in template and eliminated all models