Simplify checks with function_exists