Preprocessing work