better preprocessing