trim down to mimimal code