Refine usage of Object.keys