Epic refactor, based on the go tool.