Refactor: get rid of Util.length()