reworking AST structure to be more coherent and use template as much as possible