rework apply code