Some refactoring. Share console history