Async Interface and SQLite implementation and some refactoring