fixed file structure to keep consistency of delegates, improved dbclass to singleton