fleshed out templates and db model