Minimize query content if there is nothing to put inside it.