Changed predecon part to work with templates