Refactoring of process reading data from console.