remove the only member field by refactoring to tail recursion and other small refactoring