refactored lock tokens and added sync token parsing.