Restructured code, and added JavaBeans bindings to INSERT queries