improve scripts intelligence in order to automagically detect environment and adapt