refactor on how client data is parsed