More cleanup + fix in templar code