redesign logic for contrib