do a little refactoring
sort input data after view updated