move input logic into another file