Make code more readable, remove some dead code and have goimports fix the imports