Filter certain keys from an object without side-effects