Refactor Unidex.js