[fix] tidy up getObject helper method