Code refactoring - making preparedStatement functions more generic, in order to be used for simpleStatement