refining db engine. still very raw