Refactor openDB into a Controller method

Fix #1