fix for partial custom field and code clean up