Modified template and SQL schema