Cleanup and factored out user tracking