Function hooks in seperate file

looks neater, and easier to see stuff