Restructured database to handle directories and also use percents