updated templates to be able to handle self refrencing vars and added cool constructor arguments handling method