Python DBM, Berkeley DB, or Python sqlite local policy support
Refactor code to make it less repetitive and more maintainable
