Move database helper to core classes