[shared] Program refactored for reading data from input file