started moving code into separate files