Clean up code a bit with fmt.Errorf