Split stdin functions to seperate file