Tidied up Object.php code