Refactor multiple db support, only one engine supported for each class.