refactor for postgresql