Simplify return code handling