Improving algorithm for finding of trending articles + refactoring