Moved to postgres, changed template filtering