made object class code nicer