minor improvemnt in iterating object keys when building resources