Refactor ImageProcessor