moved query element names to vars