preprocessing improvements