please refactor it to simpler method