remove unneccessary call to getattr()