Refactoring to use Northwinnd and SQLite