Make database selectable. Clean up