Updated tools to latest releases and cleaned up code