Refactor attributes_for_sfdb.