Fixing code and templates after refactor