tidied functions into different files