remove unecessary dict, use other way to remove keys