split reg and clear functions