refactored db and all effected  modules so that :so that new types of elements can be easily added to main and directions shoud be added automatically and be able to be overridden