Separated funtions to their own file for manageability