[[ RefactorSyntax ]] Updated few lines to directly use the return value of getobj()