Refactor ugly classname getter.