rfc663 refactored