Use dynamic assignment to avoid code duplication.