Moved input functions to a separate file