delete unnecessary file.
replace pg_query with generic method call.