move consts generation to templates