add more helper and refactor