Remaining common logic extraction + few XML comments added.