moved some common functions to Tools. better handling / updating for scripts.