Refactoring of WInput history.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>