tables moved to dto
sql moved to dao
Sql queries simplified
Added folder existence checking