cleanup code for regis