defers, error checking, panic avoidance