First step of refactoring suffix tree