Started to move functions to seperate files