refactoring to satisfy gernet generator