creation and freeing of event seperated, input_type dropped, one function one file