nextfeed-5: refactored, added tests and fixed the bug.