How to design a inner class