remove unneeded $object argument

let php tell us if what's being passed is an object or not
also streamline the function a bit