Removing empty query check since it is really up to developer to take care of parameters. Some code refactoring which also improves for future mysqli upgrade.