logic helper