improving input data handling