TODO and DATABASE structure refactoring