removes unnecessary properties from objects