abstracting preprocessing