create better template and fix backwards compatibility