JBIDE-13782 further changes for better nesting

Second PR for better nesting