Refactor itext.class.js even more