clean register code