Refacted db & load modules