refactor splaytree