Fix template model, minor shapes refactor