divided the generated xml into 3 different files; code optimization; automatic environment detection