condition on inner class independent from it's outer class