Various changes to module to make it database backed for UI