optimize the increment logic & add user document