Refactor Collatz to two classes