externalize user module and general clean up