Refactor if err != nil { panic(whatever) } into functions