refactored to use postgresql instead of sqlite