Refactoring for real data input