Safer function chaining