Added some changes - rewriting templates to object system