refactoring of wikipedia api