cleaned up code into directories