getattr to reduce loc