refactoring to implement relational database scenemanager