Add dbFormat feature and some DRY fixes