class in class and interfaces for function return type def