restructing code into seperate file libaries