towers of hanoi refactor