Refactor the user tracking mechanism.