1) jdbc call fix 2) removed some redundancy