extract methods of head recursion reduction into separate class